package com.ase.数据结构;

import com.sun.org.apache.xalan.internal.xsltc.compiler.util.StringStack;

import java.util.Stack;

/**
 * @author gyhstart
 * @create 2021/2/28 - 19:59
 * 链表栈，先进后出 stack
 **/
public class MyStack {

    public static Boolean stack(){
        Stack stack = new StringStack();
        stack.push('a');
        stack.push('b');
        stack.push('c');
        System.out.println(stack.toString());
        System.out.println("stack.pop() = " + stack.pop());
        System.out.println("stack.empty() = " + stack.empty());
        System.out.println("stack.search() = " + stack.search('b'));
        System.out.println("stack.firstElement() = " + stack.firstElement());
        System.out.println("stack.peek() = " + stack.peek());
        System.out.println(stack.toString());
        return false;
    }

    public static void main(String[] args) {
        stack();
    }
}
